package me.plugin.bukkitlearning.commands;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class Announcer implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender.hasPermission("bukkitlearning.shout")){
            Bukkit.getServer().broadcastMessage("[服务器公告]" + args[0]);
        }
        else
        {
            sender.sendMessage(ChatColor.RED + "你没有权限发布公告！");
        }
        return false;
    }
}
